﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DVRMS_Renamer
{
    public partial class frmMain : Wizard.UI.WizardSheet
    {
        private wizAutoPage1 autoSummaryPage1;

        public frmMain(string FolderToScan, string FolderToCompare, AutoActions TheAutoAction)
        {
            InitializeComponent();

            Globals.selectedFolderToScan = FolderToScan;

            if (FolderToCompare != "")
            {
                Globals.compareFolders = true;
                Globals.selectedCompareFolder = FolderToCompare;
            }

            Globals.AutoAction = TheAutoAction;

            switch (Globals.AutoAction)
            {
                case (AutoActions.AutoNone):
                    this.Pages.Add(new wizPage1());
                    this.Pages.Add(new wizPage2(this));
                    this.Pages.Add(new wizPage3(this));
                    this.Pages.Add(new wizPage4(this));
                    this.Pages.Add(new wizPage5(this));
                    this.Pages.Add(new wizPage6(this));
                    this.Pages.Add(new wizPage7(this));
                    this.Pages.Add(new wizPage8(this));
                    break;

                case (AutoActions.AutoSummary):
                    autoSummaryPage1 = new wizAutoPage1();
                    this.Pages.Add(autoSummaryPage1);
                    this.Pages.Add(new wizPage8(this));
                    break;

                case (AutoActions.AutoSilent):
                    // TODO:DS AutoSilent
                    /*
                    this.Pages.Add(new wizPage1());
                    if (selectedFolderToScan == "") this.Pages.Add(new wizPage2(this));
                    this.Pages.Add(new wizPage3(this));
                    this.Pages.Add(new wizPage4(this));
                    if (selectedCompareFolder == "") this.Pages.Add(new wizPage5(this));
                    this.Pages.Add(new wizPage6(this));
                    this.Pages.Add(new wizAutoPage7(this));
                    this.Pages.Add(new wizPage8(this));
                    */
                    break;
            }
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            this.CenterToParent();
        }

        private void frmMain_Shown(object sender, EventArgs e)
        {
            if (Globals.AutoAction == AutoActions.AutoSummary)
            {
                Refresh();
                autoSummaryPage1.StartProcessing();
            }
        }
    }
}
